<template>
	<view>
		<u-sticky bgColor="#6492FF" offsetTop=0 customNavHeight=0>
			<navbox title="我的报备"></navbox>
		</u-sticky>
		<view class="con" v-if='list.length>0'>
			<view class="con__item" @click="navto('/pages/my/file?productId='+item.productId)" v-for="(item,index) in list" :key="index">
				<view class="u-flex u-flex-y-center">
					<image :src="item.productLogo" class="con__item__icon" mode="aspectFill"></image>
					<view class="con__item__center">
						<view class="con__item__name">
							{{item.productName}}
						</view>
						<view class="con__item__xx">
							报备信息：{{item.applyCount}}
						</view>
					</view>
				</view>
				<view class="con__item__ck">
					查看
					<image src="/static/img/home/more.png" class="con__item__ck__icon" mode=""></image>
				</view>
			</view>
		</view>
		<view class="" v-else style="margin-top: 200rpx;">
			<u-empty icon="/static/img/index/empty.png" mode="data" text="暂时没有数据"></u-empty>
		</view>
	</view>
</template>

<script>
	import {applyGroupList} from '@/api/home.js'
	export default {
		data() {
			return {
				list:[],
				productId:''
			};
		},
		onLoad(option) {
			if(option.productId){
				this.productId=option.productId
			}
			this.getlist()
		},
		methods:{
			getlist(){
				applyGroupList({productId:this.productId}).then(res=>{
					uni.stopPullDownRefresh()
					if(res.data.code==200){
						this.list=res.data.data
					}
				})
			}
		},
		onPullDownRefresh() {
			this.getlist()
		}
	}
</script>

<style lang="scss">
page{
	background-color: #f6f6f6;
}
.con{
	padding: 25rpx 16rpx;
	&__item{
		background: #FFFFFF;
		border-radius: 14rpx;
		padding: 26rpx 34rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 25rpx;
		&__icon{
			width: 104rpx;
			height: 104rpx;
			border-radius: 50%;
		}
		&__center{
			height: 104rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			margin-left: 28rpx;
		}
		&__name{
			font-family: Source Han Sans SC;
			font-weight: bold;
			font-size: 26rpx;
			color: #3E3D3D;
			line-height: 26rpx;
			margin-bottom: 24rpx;
			width: 400rpx;
		}
		&__xx{
			font-family: Source Han Sans SC;
			font-weight: 400;
			font-size: 26rpx;
			color: #707070;
			line-height: 26rpx;
		}
		&__ck{
			display: flex;
			align-items: center;
			font-family: Source Han Sans SC;
			font-weight: 400;
			font-size: 25rpx;
			color: #707070;
			line-height: 25rpx;
			&__icon{
				width: 13rpx;
				height: 26rpx;
				margin-left: 10rpx;
			}
		}
	}
}
</style>
